package com.njlime.setting.entities;

import com.njlime.core.base.entities.BaseEntityPlus;
import com.njlime.core.web.validation.RegexType;
import com.njlime.core.web.validation.annotation.Validate;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 实体类
 *
 * @since 
 */
@Entity
@Table(name = "t_announce")
public class Announce extends BaseEntityPlus{
    @Validate(description = "类型", nullable = false,regexType= RegexType.NUMBER)
    private Integer type; // 类型：1公告2帮助
	@Validate(description = "标题", nullable = false)
    private String title; // 标题
	@Validate(description = "内容", nullable = false)
    private String content; // 内容
    @Validate(description = "分类", nullable = false,regexType= RegexType.NUMBER)
    private Integer category_id; // 分类id
    @Validate(description = "发布状态", nullable = false,regexType= RegexType.NUMBER)
    private Integer publish_status; // 发布状态
    private Date publish_time; // 发布时间
    @Validate(description = "位置", nullable = false,regexType= RegexType.NUMBER)
    private Integer position; // 位置

    /**
     * 类型 ： 1帮助，2公告
     */
    public static final class AnnounceType{
        public static final int ANNOUNCE = 1;
        public static final int HELP = 2;
    }

    /**
     * 位置 ： 1第一条，2第二条，3第三条，4默认
     */
    public static final class AnnouncePosition{
        public static final int FIRST = 1;
        public static final int SECOND = 2;
        public static final int THIRD = 3;
        public static final int DEFAULT = 9;
    }


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getCategory_id() {
        return category_id;
    }

    public void setCategory_id(Integer category_id) {
        this.category_id = category_id;
    }

    public Integer getPublish_status() {
        return publish_status;
    }

    public void setPublish_status(Integer publish_status) {
        this.publish_status = publish_status;
    }

    public Date getPublish_time() {
        return publish_time;
    }

    public void setPublish_time(Date publish_time) {
        this.publish_time = publish_time;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }
}